﻿namespace Mp3Observer.Interfaces
{
    #region usings

    using System.Collections.Generic;
    using System.Collections.ObjectModel;
    using System.ComponentModel;
    using Mp3Observer.Model;

    #endregion

    /// <summary>
    /// Contract definition for data access (mp3 files)
    /// </summary>
    public interface IFileRepository
    {
        /// <summary>
        /// Occurs when [property changed].
        /// </summary>
        /// <remarks>
        /// Can be used to notify the viewmodel about a new albumlist.
        /// </remarks>
        event PropertyChangedEventHandler PropertyChanged;

        /// <summary>
        /// Gets the album list.
        /// </summary>
        /// <value>The album list.</value>
        IList<FileProperty> AlbumList { get; }

        /// <summary>
        /// Gets the files.
        /// </summary>
        /// <value>The files.</value>
        // CrossThreadObservableCollection
        ObservableCollection<FileEntity> Files { get; }

        /// <summary>
        /// Loads all files.
        /// </summary>
        /// <param name="filter">The filter.</param>
        /// <returns>number of loaded files</returns>
        int LoadAllFiles(SearchFilesMessage filter);

        /// <summary>
        /// Imports the item.
        /// </summary>
        /// <param name="fileName">Name of the file.</param>
        void ImportItem(string fileName);

        /// <summary>
        /// Ends the import.
        /// </summary>
        void EndImport();

        /// <summary>
        /// Cancels the load.
        /// </summary>
        void CancelLoad();

        /// <summary>
        /// Deletes the items.
        /// </summary>
        /// <param name="items">The items.</param>
        void DeleteItems(IEnumerable<FileEntity> items);

        /// <summary>
        /// Deletes all items.
        /// </summary>
        void DeleteAllItems();
    }
}
